package com.wyc.service.impl;

import com.wyc.dao.MoveOutMapper;
import com.wyc.pojo.MoveOut;
import com.wyc.service.MoveOutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName MoveOutImp
 * @Author 王韫琛
 * @Date 2021/2/1 18:59
 * @Version 1.0
 */
@Service
public class MoveOutImp implements MoveOutService {
    @Autowired
    MoveOutMapper moveOutMapper;
    //用户名提交申请名单
    @Override
    public int submitInformation(MoveOut moveOut) {
        return moveOutMapper.submitInformation(moveOut);
    }
    //用户查看提交信息
    @Override
    public MoveOut moveOut(String username) {
        return moveOutMapper.moveOut(username);
    }
    //获取数据库信息的总条数
    @Override
    public int getTotal() {
        return moveOutMapper.getTotal();
    }

    @Override
    public List<MoveOut> superAdminFind(Integer pageNum, Integer pageSize) {
        pageNum = (pageNum-1)*pageSize;
        List<MoveOut> list =moveOutMapper.superAdminFind(pageNum, pageSize);
        return list;
    }

    @Override
    public int deleteBySuperIdentityCard(String identityCard) {
        return moveOutMapper.deleteBySuperIdentityCard(identityCard);
    }

    @Override
    public int deleteByAdminIdentityCard(String identityCard) {
        return moveOutMapper.deleteByAdminIdentityCard(identityCard);
    }

    @Override
    public int deleteByUserIdentityCard(String identityCard) {
        return moveOutMapper.deleteByUserIdentityCard(identityCard);
    }

    @Override
    public int superUpdateMoveInfo(MoveOut moveOut) {
        return moveOutMapper.superUpdateMoveInfo(moveOut);
    }
    //根据身份证查询信息
    @Override
    public MoveOut selectByIdentityCard(String identity_card)
    {
        return moveOutMapper.selectByIdentityCard(identity_card);
    }
}
